<?php
class articlesLeftMenuWidgetActions extends myFrontendAction{
	
	public function executeGetDropDown($request){
		$menu = NavigationMenu::getInstance(NavigationMenu::SUB_MENU);
		
		$q = Doctrine::getTable('Banner')->createQuery('b')
			->select('b.*')
			->from('Banner b')
			->innerJoin('b.BannerGroup bg')
			->innerJoin('bg.StructureBannerGroups sbg')
			->innerJoin('sbg.Structure s WITH s.id = ?', $request->getParameter('id'))
			->where('bg.type = ?', 'special')
			->orderBy('b.pri asc')
			->limit(1);

		$banner = $q->fetchOne();
		
		return $this->renderPartial('articlesLeftMenuWidget/menuDropdown', array('banner' => $banner, 'menu' => $menu, 'id' => $request->getParameter('id')));
	}
}